package com.atguigu.eduservice.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

/**
 * @author cyt
 * @create 2020-05-07 10:35
 */
@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "edu_course")

public class EduCourse {
    /**
     * 课程ID
     */
    @TableId(value = "id", type = IdType.ID_WORKER_STR)
    private String id;

    /**
     * 课程讲师ID
     */
    @TableField(value = "teacher_id")
    private String teacherId;

    /**
     * 课程专业ID
     */
    @TableField(value = "subject_id")
    private String subjectId;

    /**
     * 课程专业父级ID
     */
    @TableField(value = "subject_parent_id")
    private String subjectParentId;

    /**
     * 课程标题
     */
    @TableField(value = "title")
    private String title;

    /**
     * 课程销售价格，设置为0则可免费观看
     */
    @TableField(value = "price")
    private BigDecimal price;

    /**
     * 总课时
     */
    @TableField(value = "lesson_num")
    private Integer lessonNum;

    /**
     * 课程封面图片路径
     */
    @TableField(value = "cover")
    private String cover;

    /**
     * 销售数量
     */
    @TableField(value = "buy_count")
    private Long buyCount;

    /**
     * 浏览数量
     */
    @TableField(value = "view_count")
    private Long viewCount;

    /**
     * 乐观锁
     */
    @TableField(value = "version")
    private Long version;

    /**
     * 课程状态 Draft未发布  Normal已发布
     */
    @TableField(value = "status")
    private String status;

    /**
     * 逻辑删除 1（true）已删除， 0（false）未删除
     */
    @TableLogic
    @TableField(value = "is_deleted")
    private Byte isDeleted;

    /**
     * 创建时间
     */
    @TableField(value = "gmt_create", fill = FieldFill.INSERT)
    private Date gmtCreate;

    /**
     * 更新时间
     */
    @TableField(value = "gmt_modified", fill= FieldFill.INSERT_UPDATE)
    private Date gmtModified;

    private static final long serialVersionUID = 1L;

    public static final String COL_ID = "id";

    public static final String COL_TEACHER_ID = "teacher_id";

    public static final String COL_SUBJECT_ID = "subject_id";

    public static final String COL_SUBJECT_PARENT_ID = "subject_parent_id";

    public static final String COL_TITLE = "title";

    public static final String COL_PRICE = "price";

    public static final String COL_LESSON_NUM = "lesson_num";

    public static final String COL_COVER = "cover";

    public static final String COL_BUY_COUNT = "buy_count";

    public static final String COL_VIEW_COUNT = "view_count";

    public static final String COL_VERSION = "version";

    public static final String COL_STATUS = "status";

    public static final String COL_IS_DELETED = "is_deleted";

    public static final String COL_GMT_CREATE = "gmt_create";

    public static final String COL_GMT_MODIFIED = "gmt_modified";
}